package com.example.music.ui.adapters

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.music.ui.fragments.HomeFragment
import com.example.music.ui.fragments.LibraryFragment
import com.example.music.ui.fragments.ProfileFragment
import com.example.music.ui.fragments.SearchFragment

class MainPagerAdapter(fragmentActivity: FragmentActivity) : FragmentStateAdapter(fragmentActivity) {
    
    override fun getItemCount(): Int = 4
    
    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> HomeFragment()
            1 -> LibraryFragment()
            2 -> SearchFragment()
            3 -> ProfileFragment()
            else -> HomeFragment()
        }
    }
}
